//
//  UITextField+Category.h
//  TextInputLimitTest
//
//  Created by David on 16/1/14.
//  Copyright © 2016年 orangeCat. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UITextField (Limit)

#pragma mark - For length
//- (void)limitTextFieldWithLength:(NSInteger)maxLength;

#pragma mark - For bytes length
/**
 *  如果是textfiled 在通知中实现
     [self.inputTF addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
    如果是textview  在代理方法中实现
 -(void)textViewDidChange:(UITextView *)textView
 *
 *  @param maxLength
 */
- (void)limitTextFieldWithBytesLength:(NSInteger)maxLength;

//需要在 textField: shouldChangeCharactersInRange: replacementString: 方法中实现
- (BOOL)isEnabledWithBytesLength:(NSInteger)maxLength shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString*)string;

@end
